#include <cstdio>


inline int row (int &number)
{
	int n = 1;

	while (n < number)
	{
		number -= n;
		++n;
	}

	return n;
}


int main ()
{
	int number, r, n, d;

	while (scanf ("%d", &number) == 1)
	{
		printf("TERM %d IS ", number);
		r = row (number);
		if (r % 2)
			n = r - (number - 1);
		else
			n = number;
		d = r - n + 1;
		printf("%d/%d\n", n, d);
	}

	return 0;
}